package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.AdvertisementByIdModel;

import java.util.List;

public class GoodsListAdapter4
        extends BaseQuickAdapter<AdvertisementByIdModel.ResultDataBean.GoodsBean, BaseViewHolder> {
    public GoodsListAdapter4(@LayoutRes int paramInt, @Nullable List<AdvertisementByIdModel.ResultDataBean.GoodsBean> paramList) {
        super(paramInt, paramList);
        Log.d("aaaaaa", "size:" + paramList.size());
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, AdvertisementByIdModel.ResultDataBean.GoodsBean paramGoodsBean) {
        Object localObject = (TextView) paramBaseViewHolder.getView(R.id.old_goods_price);
        ((TextView) localObject).getPaint().setFlags(16);
        if (((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getOldPrice() > 0.0D) {
            ((TextView) localObject).setVisibility(View.VISIBLE);
            paramBaseViewHolder.setText(R.id.old_goods_price, "¥" + ((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getOldPrice());
            paramBaseViewHolder.setText(R.id.goods_name, paramGoodsBean.getName() + " " + ((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getSpecifications());
            paramBaseViewHolder.setText(R.id.goods_price, ((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getPrice() + "");
            paramBaseViewHolder.setText(R.id.is_sale_num, paramGoodsBean.getSaleCount() + "");
            paramBaseViewHolder.setText(R.id.goods_id, paramGoodsBean.getId() + "");
            localObject = (ImageView) paramBaseViewHolder.getView(R.id.goods_img);
            if (((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getGoodsDisplayPictures().size() <= 0) {
            }
            String picUrl = ((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean.GoodsDisplayPicturesBean) ((AdvertisementByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getGoodsDisplayPictures().get(0)).getPicUrl();
            Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + picUrl).into((ImageView) localObject);
        } else {
            paramBaseViewHolder.addOnClickListener(R.id.goods_list_add_shop_cart);
            ((TextView) localObject).setVisibility(View.GONE);
            Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load(Integer.valueOf(R.drawable.img_noimg_xs)).into((ImageView) localObject);
        }
    }
}

//
///* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/GoodsListAdapter4.class
// * Java compiler version: 6 (50.0)
// * JD-Core Version:       0.7.1
// */